package com.TPsoft.cafe_server;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

/**
 * The Title Activity.
 * 
 * @since 2011/03/25 22:30
 * @author Thomas Hyun Park
 * @version 1.0
 */

public class TitleActivity extends Activity {
	
TextView blinkText;	
View titleLayout;
Animation showText;
Animation fadeText;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.title_layout);
        
        showText = AnimationUtils.loadAnimation(this, R.anim.show_animation);
        fadeText = AnimationUtils.loadAnimation(this, R.anim.fade_animation);
        showText.setAnimationListener(new AnimationListener() {
			
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
			}
			
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub
			}
			
			public void onAnimationEnd(Animation animation) {
				blinkText.startAnimation(fadeText);
			}
		});
        
        fadeText.setAnimationListener(new AnimationListener() {
			
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
			}
			
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub
			}
			
			public void onAnimationEnd(Animation animation) {
				blinkText.startAnimation(showText);
			}
		});
        
        blinkText = (TextView)findViewById(R.id.blinkText);
        blinkText.startAnimation(showText);
        
        titleLayout = findViewById(R.id.titleLayout);
        titleLayout.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent launchGroupProfile = new Intent(TitleActivity.this, GroupProfileActivity.class);
				startActivity(launchGroupProfile);
				
			}
		});
    }
}